<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>

<!--{hook forum_start.htm}-->
<header class="Hero Hero TagHero text-white hero-<?php echo $forum['fid'];?>">
    <div class="container">
        <div class="containerNarrow">
            <h2 class="Hero-title"><?php echo $forum['name']; ?></h2>
            <div class="Hero-subtitle"><?php echo $forum['brief']; ?></div>
        </div>
    </div>
</header>
<div class="container">
    <div class="sideNavContainer">
        <div class="IndexPage-results sideNavOffset">
            <div class="IndexPage-toolbar">
                <ul class="IndexPage-toolbar-view">
                    <li class="item-sort">
                        <div class="ButtonGroup Dropdown dropdown">
                            <button class="Dropdown-toggle Button" data-toggle="dropdown" aria-expanded="false">
                                <span class="Button-label"><?php echo $active == 'default' ? '最新' : '精华';?></span>
                                <i class="icon fa fa-caret-down Button-caret"></i>
                            </button>
                            <ul class="Dropdown-menu dropdown-menu">
                                <li>
                                    <a href="<?php echo url("forum-$fid");?>" class=" hasIcon" role="button" title="<?php echo lang('new_thread');?>">
                                        <?php echo $active == 'default' ? '<i class="icon fa fa-check Button-icon"></i>' : '';?>
                                        <span class="Button-label"><?php echo lang('new_thread');?></span>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo url("forum-$fid-1", array('digest'=>1) + $_GET);?>" class="hasIcon" role="button" title="<?php echo lang('digest_thread');?>">
                                        <?php echo $active == 'digest' ? '<i class="icon fa fa-check Button-icon"></i>' : '';?>
                                        <span class="Button-label"><?php echo lang('digest_thread');?></span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </li>
                </ul>
                <ul class="IndexPage-toolbar-action">
                    <?php include _include(APP_PATH.'view/htm/thread_list_mod.inc.htm');?>
                </ul>
            </div>
            <div class="DiscussionList">
                <ul class="DiscussionList-discussions threadlist">
                    <!--{hook forum_threadlist_before.htm}-->
                    <?php include _include(APP_PATH.'view/htm/thread_list.inc.htm');?>
                    <!--{hook forum_threadlist_after.htm}-->
                </ul>
                <div class="DiscussionList-loadMore">
                    <!--{hook forum_page_before.htm}-->
                    <nav class="my-3">
                        <ul class="pagination justify-content-center flex-wrap">
                            <?php echo $pagination; ?>
                        </ul>
                    </nav>
                    <!--{hook forum_page_after.htm}-->
                </div>
            </div>
        </div>
        <nav class="IndexPage-nav sideNav">
            <ul>
                <li class="item-newDiscussion App-primaryControl">
                    <a role="button" class="Button Button--primary IndexPage-newDiscussion hasIcon hero-<?php echo $forum['fid'];?>" href="<?php echo url('thread-create-'.$fid);?>">
                        <i class="icon fa fa-fw fa-edit Button-icon"></i>
                        <span class="Button-label"><?php echo lang('thread_create_new');?></span>
                    </a>
                </li>
                <li class="item-nav">
                    <div class="ButtonGroup Dropdown dropdown App-titleControl Dropdown--select">
                        <!-- 手机端：顶部中间导航 -->
                        <button class="Dropdown-toggle Button" data-toggle="dropdown">
                            <span class="Button-label"><?php echo $forum['name']; ?></span>
                            <i class="icon fa fw fa-sort Button-caret"></i>
                        </button>
                        <ul class="Dropdown-menu dropdown-menu">
                            <li class="item-allDiscussions">
                                <a href="." active="false" class=" hasIcon" role="button">
                                    <i class="icon fa fa fa-comments-o Button-icon"></i>
                                    <span class="Button-label">所有话题</span>
                                </a>
                            </li>
                            <li class="item-following">
                                <a href="###following" active="false" class=" hasIcon" type="button" title="Following">
                                    <i class="icon fa fa-fw fa-star Button-icon"></i>
                                    <span class="Button-label">关注</span>
                                </a>
                            </li>
                            <li class="item-tags">
                                <a href="###tags" active="false" class="hasIcon" type="button">
                                    <i class="icon fa fa-fw fa-th-large Button-icon"></i>
                                    <span class="Button-label">分类</span>
                                </a>
                            </li>
                            <li class="Dropdown-separator"></li>
                            <?php foreach($forumlist_show as $_forum) { ?>
                            <li fid="<?php echo $_forum['fid'];?>" data-active="fid-<?php echo $_forum['fid'];?>">
                                <a class="TagLinkButton hasIcon tags-<?php echo $_forum['fid'];?>" href="<?php echo url("forum-$_forum[fid]");?>">
                                    <span class="icon TagIcon Button-icon"></span><?php echo $_forum['name'];?>
                                </a>
                            </li>
                            <?php } ?>
                            <!-- <li class="item-moreTags">
                                <a href="###tags" active="false" type="button" title="更多">
                                    <span class="Button-label">More...</span>
                                </a>
                            </li> -->
                        </ul>
                    </div>
                </li>
            </ul>
        </nav>
    </div>
</div>


<!--{hook forum_end.htm}-->

<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>

<script>
$('li[data-active="fid-<?php echo $fid;?>"]').addClass('active');
</script>

<!--{hook forum_js.htm}-->